package com.itheima.controller;


import com.itheima.domain.User;
import com.itheima.servcie.UserServcie;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {


    @Autowired
    private UserServcie userServcie;

    @GetMapping("/user/{id}")
    public User getUser(@PathVariable("id") int id){
        return userServcie.getUser(id);

    }
}
